Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Interface (Java)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Interface_(Java)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.pygments.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Interface_Java rootpage-Interface_Java skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Interface (Java)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>An <b>interface</b> in the <a href="Java_(programming_language)" title="Java (programming language)">Java programming language</a> is an <a href="Abstract_type" title="Abstract type">abstract type</a> that is used to declare a behavior that <a href="Class_(computer_science)" class="mw-redirect" title="Class (computer science)">classes</a> must implement. They are similar to <a href="Protocol_(object-oriented_programming)" class="mw-redirect" title="Protocol (object-oriented programming)">protocols</a>. Interfaces are declared using the <code>interface</code> <a href="Java_keywords" class="mw-redirect" title="Java keywords">keyword</a>, and may only contain <a href="Method_signature" class="mw-redirect" title="Method signature">method signature</a> and constant declarations (variable declarations that are declared to be both <code><a href="Static_variable#Static_Variables_as_Class_Variables" title="Static variable">static</a></code> and <code><a href="Final_(Java)" title="Final (Java)">final</a></code>). All methods of an Interface do not contain implementation (method bodies) as of all versions below Java 8. Starting with Java 8, <code>default</code><sup id="cite_ref-FOOTNOTEBloch2018_1-0" class="reference"><a href="#cite_note-FOOTNOTEBloch2018-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 99">: 99 </span></sup> and <code>static</code><sup id="cite_ref-FOOTNOTEBloch2018_1-1" class="reference"><a href="#cite_note-FOOTNOTEBloch2018-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 7">: 7 </span></sup> methods may have implementation in the <code>interface</code> definition.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup> Then, in Java 9, <code>private</code> and <code>private static</code> methods were added. At present, a Java interface can have up to six different types.
</p><p>Interfaces cannot be <a href="Instance_(computer_science)" title="Instance (computer science)">instantiated</a>, but rather are implemented. A class that implements an interface must implement all of the non-default methods described in the interface, or be an <a href="Abstract_class" class="mw-redirect" title="Abstract class">abstract class</a>. Object references in Java may be specified to be of an interface type; in each case, they must either be <a href="Null_pointer" title="Null pointer">null</a>, or be bound to an object that implements the interface.
</p><p>One benefit of using interfaces is that they simulate <a href="Multiple_inheritance" title="Multiple inheritance">multiple inheritance</a>. All classes in Java must have exactly one <a href="Base_class" class="mw-redirect" title="Base class">base class</a>, the only exception being <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Object.html">java.lang.Object</a></code> (the <a href="Top_type" class="mw-redirect" title="Top type">root class</a> of the Java <a href="Type_system" title="Type system">type system</a>); <a href="Multiple_inheritance" title="Multiple inheritance">multiple inheritance</a> of classes is not allowed. However, an interface may inherit multiple interfaces and a class may implement multiple interfaces.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Overview">Overview</h2></div>
<p>Interfaces are used to encode similarities which the classes of various types share, but do not necessarily constitute a class relationship. For instance, a <a href="Human" title="Human">human</a> and a <a href="Parrot" title="Parrot">parrot</a> can both <a href="Whistle" title="Whistle">whistle</a>; however, it would not make sense to represent <code>Human</code>s and <code>Parrot</code>s as subclasses of a <code>Whistler</code> class. Rather they most likely be subclasses of an <code>Animal</code> class (likely with intermediate classes), but both would implement the <code>Whistler</code> interface.
</p><p>Another use of interfaces is being able to use an <a href="Object_(computer_science)" title="Object (computer science)">object</a> without knowing its type of class, but rather only that it implements a certain interface. For instance, if one were annoyed by a whistling noise, one may not know whether it is a human or a parrot, because all that could be determined is that a whistler is whistling. The call <code>whistler.whistle()</code> will call the implemented method <code>whistle</code> of object <code>whistler</code> no matter what class it has, provided it implements <code>Whistler</code>. In a more practical example, a <a href="Sorting_algorithm" title="Sorting algorithm">sorting algorithm</a> may expect an object of type <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Comparable.html">Comparable</a></code>. Thus, without knowing the specific type, it knows that objects of that type can somehow be sorted.
</p><p>For example:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">interface</span> <span class="nc">Bounceable</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">double</span><span class="w"> </span><span class="n">pi</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="mf">3.1415</span><span class="p">;</span>
<span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">setBounce</span><span class="p">();</span><span class="w"> </span><span class="c1">// Note the semicolon</span>
<span class="w"> </span><span class="c1">// Interface methods are public, abstract and never final. </span>
<span class="w"> </span><span class="c1">// Think of them as prototypes only; no implementations are allowed.</span>
<span class="p">}</span>
</pre></div>
<p>An interface:
</p>
<ul><li>declares only method headers and public constants.</li>
<li>cannot be instantiated.</li>
<li>can be implemented by a class.<sup id="cite_ref-FOOTNOTEBloch2018_1-2" class="reference"><a href="#cite_note-FOOTNOTEBloch2018-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 75">: 75 </span></sup></li>
<li>cannot extend a class.</li>
<li>can extend several other interfaces.<sup id="cite_ref-FOOTNOTEBloch2018_1-3" class="reference"><a href="#cite_note-FOOTNOTEBloch2018-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup class="reference nowrap"><span title="Page / location: 87">: 87 </span></sup></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Usage">Usage</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Defining_an_interface">Defining an interface</h3></div>
<p>Interfaces are defined with the following syntax (compare to <a href="Class_(software)" class="mw-redirect" title="Class (software)">Java's class definition</a>):
</p>
<pre>[<i>visibility</i>] interface <i><b>InterfaceName</b></i> [extends <i>other interfaces</i>] {
<i>constant declarations</i>
<i>abstract method declarations</i>
<i> static method declarations</i>
}
</pre>
<p>Example: public interface Interface1 extends Interface2;
</p><p>The body of the interface contains <a href="Method_(computer_programming)#Abstract_methods" title="Method (computer programming)">abstract methods</a>, but since all methods in an interface are, by definition, abstract, the <code>abstract</code> keyword is not required. Since the interface specifies a set of exposed behaviors, all methods are implicitly <code>public</code>.
</p><p>Thus, a simple interface may be
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">public</span><span class="w"> </span><span class="kd">interface</span> <span class="nc">Predator</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">boolean</span><span class="w"> </span><span class="nf">chasePrey</span><span class="p">(</span><span class="n">Prey</span><span class="w"> </span><span class="n">p</span><span class="p">);</span>
<span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">eatPrey</span><span class="p">(</span><span class="n">Prey</span><span class="w"> </span><span class="n">p</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
<p>The member type declarations in an interface are implicitly static, final and public, but otherwise they can be any type of class or interface.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading3"><h3 id="Implementing_interfaces_in_a_class">Implementing interfaces in a class</h3></div>
<p>The syntax for implementing an interface uses this formula:
</p>
<pre>... implements <i>InterfaceName</i>[, <i>another interface</i>, <i>another</i>, ...] ...
</pre>
<p><a href="Class_(software)" class="mw-redirect" title="Class (software)">Classes</a> may implement an interface. For example:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">public</span><span class="w"> </span><span class="kd">class</span> <span class="nc">Lion</span><span class="w"> </span><span class="kd">implements</span><span class="w"> </span><span class="n">Predator</span><span class="w"> </span><span class="p">{</span>

<span class="w"> </span><span class="nd">@Override</span>
<span class="w"> </span><span class="kd">public</span><span class="w"> </span><span class="kt">boolean</span><span class="w"> </span><span class="nf">chasePrey</span><span class="p">(</span><span class="n">Prey</span><span class="w"> </span><span class="n">p</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Programming to chase prey p (specifically for a lion)</span>
<span class="w"> </span><span class="p">}</span>

<span class="w"> </span><span class="nd">@Override</span>
<span class="w"> </span><span class="kd">public</span><span class="w"> </span><span class="kt">void</span><span class="w"> </span><span class="nf">eatPrey</span><span class="p">(</span><span class="n">Prey</span><span class="w"> </span><span class="n">p</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Programming to eat prey p (specifically for a lion)</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
<p>If a class implements an interface and does not implement all its methods, it must be marked as <code>abstract</code>. If a class is abstract, one of its <a href="Subclass_(computer_science)" class="mw-redirect" title="Subclass (computer science)">subclasses</a> is expected to implement its unimplemented methods, though if any of the abstract class' subclasses do not implement all interface methods, the subclass itself must be marked again as <code>abstract</code>.
</p><p>Classes can implement multiple interfaces:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">public</span><span class="w"> </span><span class="kd">class</span> <span class="nc">Frog</span><span class="w"> </span><span class="kd">implements</span><span class="w"> </span><span class="n">Predator</span><span class="p">,</span><span class="w"> </span><span class="n">Prey</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="p">}</span>
</pre></div>
<p>Interfaces can share common class methods:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">class</span> <span class="nc">Animal</span><span class="w"> </span><span class="kd">implements</span><span class="w"> </span><span class="n">LikesFood</span><span class="p">,</span><span class="w"> </span><span class="n">LikesWater</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="kt">boolean</span><span class="w"> </span><span class="nf">likes</span><span class="p">()</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="k">return</span><span class="w"> </span><span class="kc">true</span><span class="p">;</span><span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
</pre></div>
<p>However a given class cannot implement the same or a similar interface multiple times:
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">class</span> <span class="nc">Animal</span><span class="w"> </span><span class="kd">implements</span><span class="w"> </span><span class="n">Shares</span><span class="o">&lt;</span><span class="n">Boolean</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">Shares</span><span class="o">&lt;</span><span class="n">Integer</span><span class="o">&gt;</span><span class="w"> </span><span class="p">...</span>
<span class="c1">// Error: repeated interface</span>
</pre></div>
<p>Interfaces are commonly used in the Java language for <a href="Callback_(computer_science)" class="mw-redirect" title="Callback (computer science)">callbacks</a>,<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup> as Java does not allow multiple inheritance of classes, nor does it allow the passing of methods (procedures) as arguments. Therefore, in order to pass a method as a parameter to a target method, current practice is to define and pass a reference to an interface as a means of supplying the signature and address of the parameter method to the target method rather than defining multiple variants of the target method to accommodate each possible calling class.
</p>
<div class="mw-heading mw-heading3"><h3 id="Subinterfaces">Subinterfaces</h3></div>
<p>Interfaces can extend several other interfaces, using the same formula as described below. For example,
</p>
<div class="mw-highlight mw-highlight-lang-java mw-content-ltr" dir="ltr"><pre><span class="kd">public</span><span class="w"> </span><span class="kd">interface</span> <span class="nc">VenomousPredator</span><span class="w"> </span><span class="kd">extends</span><span class="w"> </span><span class="n">Predator</span><span class="p">,</span><span class="w"> </span><span class="n">Venomous</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="c1">// Interface body</span>
<span class="p">}</span>
</pre></div>
<p>is legal and defines a subinterface. It allows multiple inheritance, unlike classes. <code>Predator</code> and <code>Venomous</code> may possibly define or inherit methods with the same signature, say <code>kill(Prey p)</code>. When a class implements <code>VenomousPredator</code> it will implement both methods simultaneously.
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<p>Some common <a href="Java_(Sun)" class="mw-redirect" title="Java (Sun)">Java</a> interfaces are:
</p>
<ul><li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Comparable.html">Comparable</a></code> has the method <code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/lang/Comparable.html#compareTo(T)">compareTo</a></code>, which is used to describe two objects as equal, or to indicate one is greater than the other. <a href="Generic_programming" title="Generic programming">Generics</a> allow implementing classes to specify which class instances can be compared to them.</li>
<li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.base/java/io/Serializable.html">Serializable</a></code> is a <a href="Marker_interface" class="mw-redirect" title="Marker interface">marker interface</a> with no methods or fields - it has an empty body. It is used to indicate that a class can be <a href="Serialization" title="Serialization">serialized</a>. Its <a href="Javadoc" title="Javadoc">Javadoc</a> describes how it should function, although nothing is programmatically enforced</li></ul>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Interface_(object-oriented_programming)" title="Interface (object-oriented programming)">Interface (object-oriented programming)</a></li>
<li><a href="Mixin" title="Mixin">Mixin</a></li>
<li><a href="Trait_(computer_programming)" title="Trait (computer programming)">Trait (computer programming)</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="Citations">Citations</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-FOOTNOTEBloch2018-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-FOOTNOTEBloch2018_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-FOOTNOTEBloch2018_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-FOOTNOTEBloch2018_1-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-FOOTNOTEBloch2018_1-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><a href="#CITEREFBloch2018">Bloch 2018</a>.</span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation web cs1"><a rel="nofollow" class="external text" href="https://web.archive.org/web/20170523042436/http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html">"Default Methods"</a>. Archived from <a rel="nofollow" class="external text" href="http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html">the original</a> on 2017-05-23<span class="reference-accessdate">. Retrieved <span class="nowrap">2014-06-30</span></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite class="citation web cs1"><a rel="nofollow" class="external text" href="http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.5">"The Java Language Specification"</a>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFMitchell1996" class="citation web cs1">Mitchell, John D. (June 1, 1996). <a rel="nofollow" class="external text" href="https://www.infoworld.com/article/2077462/java-tip-10--implement-callback-routines-in-java.html">"Java Tip 10: Implement callback routines in Java"</a>. <i><a href="JavaWorld" class="mw-redirect" title="JavaWorld">JavaWorld</a></i><span class="reference-accessdate">. Retrieved <span class="nowrap">2020-07-14</span></span>.</cite></span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<ul><li><cite id="CITEREFBloch2018" class="citation book cs1">Bloch, Joshua (2018). <i>"Effective Java: Programming Language Guide"</i> (third&nbsp;ed.). Addison-Wesley. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0134685991</bdi>.</cite></li></ul>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><a rel="nofollow" class="external text" href="http://java.sun.com/docs/books/tutorial/java/concepts/interface.html">What Is an Interface?</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-03-28" href="https://en.wikipedia.org/wiki/?title=Interface_(Java)&amp;oldid=1282835700">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>